#include<stdio.h>
#include<string.h>

int comparenum1(int num1, int num2, int num3, int num4)
{
    int min = num1;
    int max = num1;
    if (num2 < min)
        min = num2;
    if (num3 < min)
        min = num3;
    if (num4 < min)
        min = num4;

    if (num2 > max)
        max = num2;
    if (num3 > max)
        max = num3;
    if (num4 > max)
        max = num4;

    return min;
}
int comparenum2(int num1, int num2, int num3, int num4)
{
    int min = num1;
    int max = num1;
    if (num2 < min)
        min = num2;
    if (num3 < min)
        min = num3;
    if (num4 < min)
        min = num4;

    if (num2 > max)
        max = num2;
    if (num3 > max)
        max = num3;
    if (num4 > max)
        max = num4;

    return max;
}
int main()
{
    char arr[10000] = { 0 };
    gets(arr);
    int len = strlen(arr);
    int count1 = 0;
    int count2 = 0;
    int count3 = 0;
    int count4 = 0;
    for (int i = 0; i < len; i++)
    {
        if (arr[i] == 'g' || arr[i] == 'G')
            count1++;
        else if (arr[i] == 'p' || arr[i] == 'P')
            count2++;
        else if (arr[i] == 'l' || arr[i] == 'L')
            count3++;
        else if (arr[i] == 't' || arr[i] == 'T')
            count4++;
    }
    int ret1 = comparenum1(count1, count2, count3, count4);
    while (ret1--)
    {
        printf("%s", "GPLT");
        count1--;
        count2--;
        count3--;
        count4--;
    }
    int ret2 = comparenum2(count1, count2, count3, count4);
    while (ret2--)
    {
        if (count1 > 0)
        {
            printf("%c", 'G');
            count1--;
        }
        if (count2 > 0)
        {
            printf("%c", 'P');
            count2--;
        }
        if (count3 > 0)
        {
            printf("%c", 'L');
            count3--;
        }
        if (count4 > 0)
        {
            printf("%c", 'T');
            count4--;
        }
    }
    return 0;
}